3.1332 \(\int \frac{(A+B x) (d+e x)^2}{a+c x^2} \, dx\)

Optimal. Leaf size=108 \[ \frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (-a A e^2-2 a B d e+A c d^2\right )}{\sqrt{a} c^{3/2}}+\frac{\log \left (a+c x^2\right ) \left (-a B e^2+2 A c d e+B c d^2\right )}{2 c^2}+\frac{e x (A e+2 B d)}{c}+\frac{B e^2 x^2}{2 c} \]

[Out]

(e*(2*B*d + A*e)*x)/c + (B*e^2*x^2)/(2*c) + ((A*c*d^2 - 2*a*B*d*e - a*A*e^2)*Arc
Tan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2)) + ((B*c*d^2 + 2*A*c*d*e - a*B*e^2)*L
og[a + c*x^2])/(2*c^2)

_______________________________________________________________________________________

Rubi [A]  time = 0.212286, antiderivative size = 108, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182 \[ \frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (-a A e^2-2 a B d e+A c d^2\right )}{\sqrt{a} c^{3/2}}+\frac{\log \left (a+c x^2\right ) \left (-a B e^2+2 A c d e+B c d^2\right )}{2 c^2}+\frac{e x (A e+2 B d)}{c}+\frac{B e^2 x^2}{2 c} \]

Antiderivative was successfully verified.

[In]  Int[((A + B*x)*(d + e*x)^2)/(a + c*x^2),x]

[Out]

(e*(2*B*d + A*e)*x)/c + (B*e^2*x^2)/(2*c) + ((A*c*d^2 - 2*a*B*d*e - a*A*e^2)*Arc
Tan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2)) + ((B*c*d^2 + 2*A*c*d*e - a*B*e^2)*L
og[a + c*x^2])/(2*c^2)

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \frac{B e^{2} \int x\, dx}{c} + \frac{\left (A e + 2 B d\right ) \int e\, dx}{c} - \frac{\left (- 2 A c d e + B a e^{2} - B c d^{2}\right ) \log{\left (a + c x^{2} \right )}}{2 c^{2}} - \frac{\left (A a e^{2} - A c d^{2} + 2 B a d e\right ) \operatorname{atan}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{\sqrt{a} c^{\frac{3}{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((B*x+A)*(e*x+d)**2/(c*x**2+a),x)

[Out]

B*e**2*Integral(x, x)/c + (A*e + 2*B*d)*Integral(e, x)/c - (-2*A*c*d*e + B*a*e**
2 - B*c*d**2)*log(a + c*x**2)/(2*c**2) - (A*a*e**2 - A*c*d**2 + 2*B*a*d*e)*atan(
sqrt(c)*x/sqrt(a))/(sqrt(a)*c**(3/2))

_______________________________________________________________________________________

Mathematica [A]  time = 0.166505, size = 99, normalized size = 0.92 \[ \frac{\log \left (a+c x^2\right ) \left (-a B e^2+2 A c d e+B c d^2\right )-\frac{2 \sqrt{c} \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (a A e^2+2 a B d e-A c d^2\right )}{\sqrt{a}}+c e x (2 A e+4 B d+B e x)}{2 c^2} \]

Antiderivative was successfully verified.

[In]  Integrate[((A + B*x)*(d + e*x)^2)/(a + c*x^2),x]

[Out]

(c*e*x*(4*B*d + 2*A*e + B*e*x) - (2*Sqrt[c]*(-(A*c*d^2) + 2*a*B*d*e + a*A*e^2)*A
rcTan[(Sqrt[c]*x)/Sqrt[a]])/Sqrt[a] + (B*c*d^2 + 2*A*c*d*e - a*B*e^2)*Log[a + c*
x^2])/(2*c^2)

_______________________________________________________________________________________

Maple [A]  time = 0.006, size = 148, normalized size = 1.4 \[{\frac{B{e}^{2}{x}^{2}}{2\,c}}+{\frac{A{e}^{2}x}{c}}+2\,{\frac{Bdex}{c}}+{\frac{\ln \left ( c{x}^{2}+a \right ) Ade}{c}}-{\frac{\ln \left ( c{x}^{2}+a \right ) aB{e}^{2}}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+a \right ) B{d}^{2}}{2\,c}}-{\frac{Aa{e}^{2}}{c}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{{d}^{2}A\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}-2\,{\frac{aBde}{c\sqrt{ac}}\arctan \left ({\frac{cx}{\sqrt{ac}}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((B*x+A)*(e*x+d)^2/(c*x^2+a),x)

[Out]

1/2*B*e^2*x^2/c+1/c*e^2*A*x+2/c*e*B*d*x+1/c*ln(c*x^2+a)*A*d*e-1/2/c^2*ln(c*x^2+a
)*a*B*e^2+1/2/c*ln(c*x^2+a)*B*d^2-1/c/(a*c)^(1/2)*arctan(c*x/(a*c)^(1/2))*A*a*e^
2+1/(a*c)^(1/2)*arctan(c*x/(a*c)^(1/2))*A*d^2-2/c/(a*c)^(1/2)*arctan(c*x/(a*c)^(
1/2))*a*B*d*e

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)*(e*x + d)^2/(c*x^2 + a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.290169, size = 1, normalized size = 0.01 \[ \left [-\frac{{\left (A c^{2} d^{2} - 2 \, B a c d e - A a c e^{2}\right )} \log \left (-\frac{2 \, a c x -{\left (c x^{2} - a\right )} \sqrt{-a c}}{c x^{2} + a}\right ) -{\left (B c e^{2} x^{2} + 2 \,{\left (2 \, B c d e + A c e^{2}\right )} x +{\left (B c d^{2} + 2 \, A c d e - B a e^{2}\right )} \log \left (c x^{2} + a\right )\right )} \sqrt{-a c}}{2 \, \sqrt{-a c} c^{2}}, \frac{2 \,{\left (A c^{2} d^{2} - 2 \, B a c d e - A a c e^{2}\right )} \arctan \left (\frac{\sqrt{a c} x}{a}\right ) +{\left (B c e^{2} x^{2} + 2 \,{\left (2 \, B c d e + A c e^{2}\right )} x +{\left (B c d^{2} + 2 \, A c d e - B a e^{2}\right )} \log \left (c x^{2} + a\right )\right )} \sqrt{a c}}{2 \, \sqrt{a c} c^{2}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)*(e*x + d)^2/(c*x^2 + a),x, algorithm="fricas")

[Out]

[-1/2*((A*c^2*d^2 - 2*B*a*c*d*e - A*a*c*e^2)*log(-(2*a*c*x - (c*x^2 - a)*sqrt(-a
*c))/(c*x^2 + a)) - (B*c*e^2*x^2 + 2*(2*B*c*d*e + A*c*e^2)*x + (B*c*d^2 + 2*A*c*
d*e - B*a*e^2)*log(c*x^2 + a))*sqrt(-a*c))/(sqrt(-a*c)*c^2), 1/2*(2*(A*c^2*d^2 -
 2*B*a*c*d*e - A*a*c*e^2)*arctan(sqrt(a*c)*x/a) + (B*c*e^2*x^2 + 2*(2*B*c*d*e +
A*c*e^2)*x + (B*c*d^2 + 2*A*c*d*e - B*a*e^2)*log(c*x^2 + a))*sqrt(a*c))/(sqrt(a*
c)*c^2)]

_______________________________________________________________________________________

Sympy [A]  time = 6.22915, size = 423, normalized size = 3.92 \[ \frac{B e^{2} x^{2}}{2 c} + \left (- \frac{- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} - \frac{\sqrt{- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right ) \log{\left (x + \frac{2 A a c d e - B a^{2} e^{2} + B a c d^{2} - 2 a c^{2} \left (- \frac{- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} - \frac{\sqrt{- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right )}{A a c e^{2} - A c^{2} d^{2} + 2 B a c d e} \right )} + \left (- \frac{- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} + \frac{\sqrt{- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right ) \log{\left (x + \frac{2 A a c d e - B a^{2} e^{2} + B a c d^{2} - 2 a c^{2} \left (- \frac{- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} + \frac{\sqrt{- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right )}{A a c e^{2} - A c^{2} d^{2} + 2 B a c d e} \right )} + \frac{x \left (A e^{2} + 2 B d e\right )}{c} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x+A)*(e*x+d)**2/(c*x**2+a),x)

[Out]

B*e**2*x**2/(2*c) + (-(-2*A*c*d*e + B*a*e**2 - B*c*d**2)/(2*c**2) - sqrt(-a*c**5
)*(A*a*e**2 - A*c*d**2 + 2*B*a*d*e)/(2*a*c**4))*log(x + (2*A*a*c*d*e - B*a**2*e*
*2 + B*a*c*d**2 - 2*a*c**2*(-(-2*A*c*d*e + B*a*e**2 - B*c*d**2)/(2*c**2) - sqrt(
-a*c**5)*(A*a*e**2 - A*c*d**2 + 2*B*a*d*e)/(2*a*c**4)))/(A*a*c*e**2 - A*c**2*d**
2 + 2*B*a*c*d*e)) + (-(-2*A*c*d*e + B*a*e**2 - B*c*d**2)/(2*c**2) + sqrt(-a*c**5
)*(A*a*e**2 - A*c*d**2 + 2*B*a*d*e)/(2*a*c**4))*log(x + (2*A*a*c*d*e - B*a**2*e*
*2 + B*a*c*d**2 - 2*a*c**2*(-(-2*A*c*d*e + B*a*e**2 - B*c*d**2)/(2*c**2) + sqrt(
-a*c**5)*(A*a*e**2 - A*c*d**2 + 2*B*a*d*e)/(2*a*c**4)))/(A*a*c*e**2 - A*c**2*d**
2 + 2*B*a*c*d*e)) + x*(A*e**2 + 2*B*d*e)/c

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.277455, size = 136, normalized size = 1.26 \[ \frac{{\left (A c d^{2} - 2 \, B a d e - A a e^{2}\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{\sqrt{a c} c} + \frac{{\left (B c d^{2} + 2 \, A c d e - B a e^{2}\right )}{\rm ln}\left (c x^{2} + a\right )}{2 \, c^{2}} + \frac{B c x^{2} e^{2} + 4 \, B c d x e + 2 \, A c x e^{2}}{2 \, c^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)*(e*x + d)^2/(c*x^2 + a),x, algorithm="giac")

[Out]

(A*c*d^2 - 2*B*a*d*e - A*a*e^2)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + 1/2*(B*c*d
^2 + 2*A*c*d*e - B*a*e^2)*ln(c*x^2 + a)/c^2 + 1/2*(B*c*x^2*e^2 + 4*B*c*d*x*e + 2
*A*c*x*e^2)/c^2